<?php

		include_once "../config.inc.php";
		include_once '../controladores/ControladorElementos.php';
		
		$textContent = $_POST["textarea"];
		$command = new ControladorElementos(TEXT_ELEMENT);		
		
			$usr = $_GET['usr'];
			$app = $_GET['app'];
			$secc = $_GET['sec'];
			
		$orderNewElement = $command->obtainOrderNewElement($app,$secc) + 1;
		
		$command->createElement(array("sec_id" => $secc,"text_content" => $textContent,"element_order" => $orderNewElement));	
		
		header("Location:section_elements.php?usr=".$usr."&app=".$app."&sec=".$secc."");

?>